package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishFlavorMapper {

    /**
     * 菜品口味添加
     */
    void batchInsert(List<DishFlavor> list);

    /**
     * 通过菜品id 批量删除风味数据
     * @param ids
     */
    void deleteBatch(List<Long> ids);

    @Select("select *from dish_flavor where dish_id = #{dishId}")
    List<DishFlavor> queryByDishId(Long dishId);

    void updateBatch(List<DishFlavor> flavors);

    @Delete("delete from dish_flavor where dish_id = #{id}")
    void deleteByDishId(Long id);
}
